{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "fc9cebd4",
   "metadata": {},
   "source": [
    "## 初始化环境"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "7b2e6086",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import gym\n",
    " \n",
    "env = gym.make(\"Blackjack-v1\")  #加载21点游戏环境Blackjack-v1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "60752f8d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Tuple(Discrete(32), Discrete(11), Discrete(2))"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 查看观测空间\n",
    "env.observation_space"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "fa8b4638",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Discrete(2)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 查看行为空间\n",
    "env.action_space"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ba1bab38",
   "metadata": {},
   "source": [
    "## 21点游戏过程"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "4d21061d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(12, 9, False)"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 胜利\n",
    "state, _ = env.reset()\n",
    "state"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "21475918",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "((18, 9, False), 0.0, False)"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "next_state, reward, terminated, truncated, info = env.step(1) #要牌\n",
    "next_state, reward, terminated"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "3315607f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "((18, 9, False), 1.0, True)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "next_state, reward, terminated, truncated, info = env.step(0) #不要牌\n",
    "next_state, reward, terminated"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "090338bd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(21, 2, True)"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 胜利\n",
    "state, _ = env.reset()\n",
    "state"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "586ab71f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "((21, 2, True), 1.0, True)"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "next_state, reward, terminated, truncated, info = env.step(0) #不要牌\n",
    "next_state, reward, terminated"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "ca534178",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(5, 2, False)"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 失败\n",
    "state, _ = env.reset()\n",
    "state"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "a3587068",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "((5, 2, False), -1.0, True)"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "next_state, reward, terminated, truncated, info = env.step(0) #不要牌\n",
    "next_state, reward, terminated"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "1321a67f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(16, 10, False)"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 失败\n",
    "state, _ = env.reset()\n",
    "state"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "53f7e322",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "((26, 10, False), -1.0, True)"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "next_state, reward, terminated, truncated, info = env.step(1) #要牌\n",
    "next_state, reward, terminated"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d3a7b8b3",
   "metadata": {},
   "source": [
    "## 蒙特卡洛方法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "6b8c4cc0",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 初始化Q值表，用于存储Q(state,action)\n",
    "Q = {}\n",
    "explore_rate = 0.2 # 探索率为0.2\n",
    "policy = {} # 创建空字典作为策略表，存储在状态s下选择动作a的概率\n",
    "rewards = {} # 创建空字典用于保存(state,action)对的累积奖励\n",
    "num_episodes = 5000 # 总回合数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "23381c19",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 模拟回合\n",
    "def generate_episode(Q,policy):\n",
    "    #回合观测序列列表\n",
    "    episode = []\n",
    "    # 初始化环境并获取初始状态\n",
    "    state, _ = env.reset()\n",
    "    while True:\n",
    "        # 若状态s第一次出现，将它添加到Q和policy中\n",
    "        if state not in Q.keys():\n",
    "            Q[state] = {0:0, 1:0} #初始化stick和hit的Q值\n",
    "            policy[state] = [0.5, 0.5] #初始化stick和hit的概率，各为0.5\n",
    "            rewards[state] = {0:[] , 1: []} #初始化空列表用于存储累积奖励\n",
    "        # 利用policy采样一个动作\n",
    "        action = np.random.choice([0,1], p=policy[state],size=1)[0]\n",
    "        #与环境交互，产生奖励与下一状态\n",
    "        next_state, reward, terminated, truncated, info = env.step(action)\n",
    "        #将状态state、动作action、奖励reward添加到episode中\n",
    "        episode.append((state, action, reward))\n",
    "        #到达终止状态，循环结束\n",
    "        if terminated:\n",
    "            break\n",
    "        state = next_state\n",
    "    return episode"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "af54eb21",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 开始学习\n",
    "for i in range(num_episodes):\n",
    "    #产生一个观测序列，包括该回合每一步的state,action, reward\n",
    "    episode = generate_episode(Q, policy)\n",
    "    #初始化该回合累积奖励\n",
    "    episode_sum_reward = 0.0\n",
    "    #反向遍历观测序列中的每一步\n",
    "    for t in range(len(episode))[::-1]:\n",
    "        #分别保存每一步的状态、动作和奖励\n",
    "        state ,action, reward = episode[t]\n",
    "        #计算累积奖励\n",
    "        episode_sum_reward += reward\n",
    "        #将episode_sum_reward加入（state，action）的rewards中\n",
    "        rewards[state][action].append(episode_sum_reward)\n",
    "        # 更新Q表中的Q值\n",
    "        Q[state][action] = np.mean(rewards[state][action])\n",
    "        # 更新策略\n",
    "        policy_action = np.argmax(list(Q[state].values()))\n",
    "        policy[state][policy_action] = 1 - explore_rate\n",
    "        policy[state][1 - policy_action] = explore_rate"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "fe5ab877",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{(15, 2, False): {0: -0.8571428571428571, 1: -0.7352941176470589},\n",
       " (13, 6, True): {0: -0.2, 1: -1.0},\n",
       " (10, 1, False): {0: -1.0, 1: 0.125},\n",
       " (9, 7, False): {0: -1.0, 1: -0.3333333333333333},\n",
       " (19, 7, False): {0: 0.391304347826087, 1: -1.0},\n",
       " (19, 10, False): {0: -0.15555555555555556, 1: -0.76},\n",
       " (12, 10, False): {0: -0.7142857142857143, 1: -0.44715447154471544},\n",
       " (15, 7, False): {0: -0.5652173913043478, 1: -0.6666666666666666},\n",
       " (16, 10, False): {0: -0.6491228070175439, 1: -0.84375},\n",
       " (15, 1, True): {0: -1.0, 1: -0.5},\n",
       " (12, 7, False): {0: -0.4, 1: -0.2},\n",
       " (5, 10, False): {0: -0.6666666666666666, 1: -0.6},\n",
       " (15, 10, False): {0: -0.6, 1: -0.7857142857142857},\n",
       " (21, 8, True): {0: 1.0, 1: 0.125},\n",
       " (20, 10, False): {0: 0.4305555555555556, 1: -0.9487179487179487},\n",
       " (17, 10, False): {0: -0.41964285714285715, 1: -0.7878787878787878},\n",
       " (13, 1, False): {0: -0.696969696969697, 1: -0.6428571428571429},\n",
       " (19, 1, False): {0: -0.15625, 1: -1.0},\n",
       " (10, 6, False): {0: -0.5, 1: 0.3333333333333333},\n",
       " (20, 6, False): {0: 0.8, 1: -1.0},\n",
       " (11, 1, False): {0: -1.0, 1: -0.13636363636363635},\n",
       " (8, 10, False): {0: -0.5, 1: -0.6},\n",
       " (11, 10, False): {0: -0.7647058823529411, 1: -0.17142857142857143},\n",
       " (21, 10, False): {0: 0.92, 1: -1.0},\n",
       " (10, 10, False): {0: -0.7777777777777778, 1: -0.24324324324324326},\n",
       " (14, 5, False): {0: -0.06666666666666667, 1: -0.6153846153846154},\n",
       " (20, 5, False): {0: 0.7096774193548387, 1: -0.9090909090909091},\n",
       " (17, 4, True): {0: 0.0, 1: -0.125},\n",
       " (19, 4, True): {0: 0.0, 1: 0},\n",
       " (20, 7, False): {0: 0.8387096774193549, 1: -0.8},\n",
       " (8, 4, False): {0: -0.2, 1: -0.3333333333333333},\n",
       " (16, 4, False): {0: 0.16129032258064516, 1: -0.8181818181818182},\n",
       " (16, 8, False): {0: -0.6, 1: -0.75},\n",
       " (20, 8, False): {0: 0.9534883720930233, 1: -1.0},\n",
       " (13, 10, False): {0: -0.41025641025641024, 1: -0.4634146341463415},\n",
       " (9, 10, False): {0: -0.6, 1: -0.28888888888888886},\n",
       " (9, 1, False): {0: -1.0, 1: -0.1111111111111111},\n",
       " (9, 4, False): {0: -0.3333333333333333, 1: -0.2727272727272727},\n",
       " (11, 4, False): {0: -0.2857142857142857, 1: 0.3333333333333333},\n",
       " (18, 4, False): {0: 0.2222222222222222, 1: -0.5},\n",
       " (17, 10, True): {0: -0.75, 1: -0.05},\n",
       " (21, 10, True): {0: 0.855072463768116, 1: -0.08695652173913043},\n",
       " (18, 5, False): {0: 0.4, 1: -1.0},\n",
       " (14, 8, False): {0: -0.6666666666666666, 1: -0.6428571428571429},\n",
       " (19, 8, False): {0: 0.6956521739130435, 1: -0.6},\n",
       " (9, 3, False): {0: 0.0, 1: 0},\n",
       " (20, 2, False): {0: 0.7142857142857143, 1: -1.0},\n",
       " (7, 3, False): {0: 0.14285714285714285, 1: -0.16666666666666666},\n",
       " (16, 9, False): {0: -0.4074074074074074, 1: -0.6666666666666666},\n",
       " (12, 2, False): {0: -0.5, 1: -0.7777777777777778},\n",
       " (17, 9, False): {0: -0.5263157894736842, 1: -0.7777777777777778},\n",
       " (10, 4, False): {0: 0.75, 1: 0.25},\n",
       " (20, 4, False): {0: 0.6222222222222222, 1: -0.8181818181818182},\n",
       " (13, 3, False): {0: -0.7777777777777778, 1: -0.125},\n",
       " (13, 7, False): {0: -0.7142857142857143, 1: -0.5},\n",
       " (16, 7, False): {0: -0.4375, 1: -0.8333333333333334},\n",
       " (13, 4, True): {0: -1.0, 1: 0.3333333333333333},\n",
       " (14, 2, True): {0: -1.0, 1: -0.3333333333333333},\n",
       " (19, 2, True): {0: -0.14285714285714285, 1: 0.0},\n",
       " (19, 2, False): {0: 0.4444444444444444, 1: -0.875},\n",
       " (18, 10, False): {0: -0.41025641025641024, 1: -0.8928571428571429},\n",
       " (6, 4, False): {0: -1.0, 1: 0.5},\n",
       " (17, 5, False): {0: 0.2, 1: -0.5714285714285714},\n",
       " (12, 1, False): {0: -1.0, 1: -0.6153846153846154},\n",
       " (20, 1, False): {0: 0.30952380952380953, 1: -1.0},\n",
       " (15, 6, False): {0: -0.08333333333333333, 1: -0.3333333333333333},\n",
       " (18, 6, False): {0: 0.2, 1: -0.5},\n",
       " (12, 8, False): {0: -0.5, 1: -0.38461538461538464},\n",
       " (21, 8, False): {0: 1.0, 1: -1.0},\n",
       " (15, 1, False): {0: -0.75, 1: -0.8421052631578947},\n",
       " (15, 5, False): {0: -0.18181818181818182, 1: -0.4},\n",
       " (7, 10, False): {0: -0.8571428571428571, 1: -0.42857142857142855},\n",
       " (14, 10, False): {0: -0.5319148936170213, 1: -0.5957446808510638},\n",
       " (15, 4, False): {0: -0.06666666666666667, 1: -0.6},\n",
       " (12, 9, False): {0: -1.0, 1: -0.41304347826086957},\n",
       " (19, 9, False): {0: 0.42857142857142855, 1: -0.7142857142857143},\n",
       " (16, 3, False): {0: -0.5, 1: -0.25},\n",
       " (13, 8, False): {0: -0.6923076923076923, 1: -0.4444444444444444},\n",
       " (19, 6, False): {0: 0.6206896551724138, 1: -1.0},\n",
       " (12, 10, True): {0: -0.3333333333333333, 1: 0.3333333333333333},\n",
       " (13, 6, False): {0: -0.2, 1: -0.5},\n",
       " (19, 3, False): {0: 0.38461538461538464, 1: -1.0},\n",
       " (14, 1, False): {0: -0.8666666666666667, 1: -1.0},\n",
       " (17, 1, False): {0: -0.875, 1: -0.3684210526315789},\n",
       " (12, 3, False): {0: -0.6666666666666666, 1: -0.3333333333333333},\n",
       " (17, 3, False): {0: 0.06451612903225806, 1: -0.5833333333333334},\n",
       " (18, 3, False): {0: 0.23333333333333334, 1: -0.6},\n",
       " (14, 5, True): {0: -1.0, 1: -0.5},\n",
       " (10, 3, False): {0: -1.0, 1: 0.25},\n",
       " (14, 3, False): {0: 0.06666666666666667, 1: -0.18181818181818182},\n",
       " (13, 5, False): {0: -0.14285714285714285, 1: -0.5},\n",
       " (4, 3, False): {0: -1.0, 1: 1.0},\n",
       " (10, 5, False): {0: 0.5, 1: 0.0},\n",
       " (12, 7, True): {0: -0.6666666666666666, 1: -1.0},\n",
       " (21, 4, True): {0: 1.0, 1: 0.0},\n",
       " (21, 3, True): {0: 1.0, 1: 0.0},\n",
       " (7, 8, False): {0: -1.0, 1: -1.0},\n",
       " (11, 7, False): {0: -0.42857142857142855, 1: 0.0},\n",
       " (8, 2, False): {0: -0.07692307692307693, 1: -1.0},\n",
       " (21, 2, True): {0: 1.0, 1: 0.0},\n",
       " (12, 6, False): {0: -0.02702702702702703, 1: -0.7142857142857143},\n",
       " (7, 5, False): {0: -0.3333333333333333, 1: 0.0},\n",
       " (21, 5, True): {0: 1.0, 1: 0.42857142857142855},\n",
       " (5, 2, False): {0: 0.0, 1: -1.0},\n",
       " (9, 2, False): {0: -1.0, 1: 0.2},\n",
       " (14, 1, True): {0: -1.0, 1: -1.0},\n",
       " (17, 7, False): {0: -0.15151515151515152, 1: -0.9090909090909091},\n",
       " (7, 2, False): {0: 0.0, 1: 0.25},\n",
       " (11, 6, False): {0: -0.42857142857142855, 1: 0.16666666666666666},\n",
       " (20, 10, True): {0: 0.25, 1: 0.3333333333333333},\n",
       " (21, 1, True): {0: 0.7142857142857143, 1: -0.2},\n",
       " (21, 6, True): {0: 1.0, 1: -1.0},\n",
       " (14, 7, False): {0: -0.42857142857142855, 1: -0.8571428571428571},\n",
       " (17, 8, False): {0: -0.07142857142857142, 1: -0.6666666666666666},\n",
       " (12, 5, False): {0: 0.14285714285714285, 1: -1.0},\n",
       " (21, 5, False): {0: 0.8333333333333334, 1: -1.0},\n",
       " (19, 5, False): {0: 0.4482758620689655, 1: -0.75},\n",
       " (15, 9, False): {0: -0.4375, 1: -0.9},\n",
       " (13, 9, False): {0: -0.7777777777777778, 1: -0.5555555555555556},\n",
       " (21, 9, False): {0: 1.0, 1: -1.0},\n",
       " (18, 2, False): {0: -0.04, 1: -1.0},\n",
       " (7, 6, False): {0: 0.25, 1: -0.5},\n",
       " (14, 2, False): {0: -0.8, 1: -0.6363636363636364},\n",
       " (18, 7, False): {0: 0.3142857142857143, 1: -0.8},\n",
       " (4, 8, False): {0: -1.0, 1: 1.0},\n",
       " (19, 1, True): {0: -0.125, 1: -1.0},\n",
       " (8, 6, False): {0: 0.0, 1: -0.16666666666666666},\n",
       " (14, 4, False): {0: -0.2, 1: -0.6470588235294118},\n",
       " (19, 4, False): {0: 0.5217391304347826, 1: -1.0},\n",
       " (17, 7, True): {0: 0.0, 1: 0.4444444444444444},\n",
       " (18, 7, True): {0: 0.8, 1: -1.0},\n",
       " (12, 5, True): {0: 0, 1: 0.3333333333333333},\n",
       " (17, 5, True): {0: -0.5, 1: -0.5},\n",
       " (13, 10, True): {0: -0.75, 1: -1.0},\n",
       " (15, 10, True): {0: -0.6, 1: 0.14285714285714285},\n",
       " (11, 5, False): {0: -1.0, 1: 0.3333333333333333},\n",
       " (18, 9, False): {0: -0.18421052631578946, 1: -1.0},\n",
       " (21, 1, False): {0: 0.7333333333333333, 1: -1.0},\n",
       " (7, 4, False): {0: 0.0, 1: -0.2},\n",
       " (8, 1, False): {0: -1.0, 1: -0.4166666666666667},\n",
       " (16, 5, False): {0: -0.2222222222222222, 1: -1.0},\n",
       " (20, 9, False): {0: 0.6956521739130435, 1: -0.8},\n",
       " (8, 3, False): {0: -0.1111111111111111, 1: 0.0},\n",
       " (17, 4, False): {0: 0.08, 1: -0.2},\n",
       " (21, 4, False): {0: 0.9090909090909091, 1: -1.0},\n",
       " (21, 6, False): {0: 1.0, 1: -1.0},\n",
       " (21, 7, False): {0: 0.7272727272727273, 1: -1.0},\n",
       " (18, 8, False): {0: -0.06666666666666667, 1: -0.5555555555555556},\n",
       " (18, 8, True): {0: 0.2, 1: -1.0},\n",
       " (21, 7, True): {0: 1.0, 1: 0.3333333333333333},\n",
       " (10, 8, False): {0: -0.42857142857142855, 1: 0.18181818181818182},\n",
       " (15, 8, False): {0: -0.28, 1: -0.6},\n",
       " (18, 5, True): {0: -0.14285714285714285, 1: -1.0},\n",
       " (17, 2, False): {0: -0.3333333333333333, 1: -0.5555555555555556},\n",
       " (12, 4, False): {0: -0.2857142857142857, 1: -0.2571428571428571},\n",
       " (11, 8, False): {0: -1.0, 1: 0.14285714285714285},\n",
       " (16, 9, True): {0: -1.0, 1: 0.4},\n",
       " (7, 7, False): {0: -0.5555555555555556, 1: -1.0},\n",
       " (16, 2, False): {0: 0.09090909090909091, 1: -0.7142857142857143},\n",
       " (10, 2, False): {0: -0.5, 1: -0.08333333333333333},\n",
       " (13, 2, False): {0: 0.0, 1: -0.5},\n",
       " (16, 1, False): {0: -0.6470588235294118, 1: -0.7272727272727273},\n",
       " (5, 1, False): {0: 0.0, 1: -1.0},\n",
       " (6, 1, False): {0: -1.0, 1: -1.0},\n",
       " (5, 3, False): {0: -1.0, 1: -1.0},\n",
       " (11, 3, False): {0: -0.14285714285714285, 1: 0.0},\n",
       " (18, 10, True): {0: -0.23529411764705882, 1: -0.6},\n",
       " (5, 4, False): {0: 1.0, 1: 1.0},\n",
       " (17, 6, False): {0: -0.1111111111111111, 1: -0.25},\n",
       " (12, 1, True): {0: -1.0, 1: -0.6666666666666666},\n",
       " (9, 8, False): {0: -1.0, 1: 0.26666666666666666},\n",
       " (14, 9, True): {0: -1.0, 1: -1.0},\n",
       " (8, 9, False): {0: -0.7142857142857143, 1: 0.25},\n",
       " (14, 10, True): {0: -0.8, 1: -1.0},\n",
       " (15, 7, True): {0: -1.0, 1: 0.2},\n",
       " (4, 5, False): {0: 1.0, 1: -1.0},\n",
       " (20, 3, False): {0: 0.6666666666666666, 1: -0.7777777777777778},\n",
       " (21, 3, False): {0: 0.8125, 1: -1.0},\n",
       " (19, 6, True): {0: -1.0, 1: 0.0},\n",
       " (13, 2, True): {0: -1.0, 1: -0.2},\n",
       " (15, 8, True): {0: -0.3333333333333333, 1: -0.3333333333333333},\n",
       " (6, 2, False): {0: 1.0, 1: -1.0},\n",
       " (14, 9, False): {0: -0.6, 1: -0.39473684210526316},\n",
       " (6, 10, False): {0: -0.9, 1: -1.0},\n",
       " (10, 7, False): {0: -0.5294117647058824, 1: -1.0},\n",
       " (15, 3, True): {0: 0.0, 1: 1.0},\n",
       " (4, 9, False): {0: -1.0, 1: -1.0},\n",
       " (8, 7, False): {0: -0.3333333333333333, 1: -0.16666666666666666},\n",
       " (15, 3, False): {0: -0.2631578947368421, 1: -0.43478260869565216},\n",
       " (7, 1, False): {0: -1.0, 1: -0.16666666666666666},\n",
       " (11, 9, False): {0: -1.0, 1: -0.07142857142857142},\n",
       " (13, 4, False): {0: -0.8461538461538461, 1: -0.15789473684210525},\n",
       " (16, 2, True): {0: 0.14285714285714285, 1: -1.0},\n",
       " (16, 3, True): {0: -1.0, 1: -0.14285714285714285},\n",
       " (19, 10, True): {0: 0.05555555555555555, 1: -0.42857142857142855},\n",
       " (18, 1, False): {0: -0.35, 1: -0.8571428571428571},\n",
       " (10, 9, False): {0: -1.0, 1: 0.2631578947368421},\n",
       " (15, 5, True): {0: -0.3333333333333333, 1: 0.0},\n",
       " (16, 6, False): {0: -0.2, 1: -0.6},\n",
       " (17, 8, True): {0: 0.0, 1: -1.0},\n",
       " (20, 3, True): {0: 0.2, 1: -1.0},\n",
       " (16, 1, True): {0: 0.0, 1: -1.0},\n",
       " (5, 5, False): {0: 0.5, 1: -1.0},\n",
       " (21, 2, False): {0: 0.8333333333333334, 1: -1.0},\n",
       " (19, 3, True): {0: 0.2857142857142857, 1: -1.0},\n",
       " (6, 7, False): {0: -0.5, 1: -1.0},\n",
       " (8, 8, False): {0: 0.0, 1: 0.125},\n",
       " (6, 8, False): {0: -1.0, 1: -0.3333333333333333},\n",
       " (6, 6, False): {0: -1.0, 1: -0.14285714285714285},\n",
       " (15, 6, True): {0: 1.0, 1: 0.5},\n",
       " (17, 9, True): {0: 0.5, 1: 0.0},\n",
       " (18, 9, True): {0: -1.0, 1: -0.5},\n",
       " (18, 2, True): {0: 0, 1: 0.0},\n",
       " (9, 6, False): {0: 0.6, 1: 0.0},\n",
       " (9, 9, False): {0: -0.2, 1: 0.4166666666666667},\n",
       " (17, 6, True): {0: 0.2, 1: 0},\n",
       " (12, 8, True): {0: -1.0, 1: 1.0},\n",
       " (14, 7, True): {0: -1.0, 1: 0.0},\n",
       " (16, 7, True): {0: 0.0, 1: -0.6666666666666666},\n",
       " (19, 9, True): {0: 0.5, 1: -1.0},\n",
       " (14, 6, True): {0: 0.0, 1: 0.5},\n",
       " (12, 3, True): {0: 0.0, 1: -1.0},\n",
       " (14, 6, False): {0: -0.6923076923076923, 1: -0.32432432432432434},\n",
       " (21, 9, True): {0: 1.0, 1: 0.3333333333333333},\n",
       " (16, 10, True): {0: -1.0, 1: -0.6666666666666666},\n",
       " (15, 4, True): {0: -1.0, 1: -0.3333333333333333},\n",
       " (20, 7, True): {0: 1.0, 1: 0.75},\n",
       " (20, 6, True): {0: 0.5, 1: -1.0},\n",
       " (20, 4, True): {0: -1.0, 1: 0.7142857142857143},\n",
       " (13, 8, True): {0: -0.3333333333333333, 1: 0.0},\n",
       " (20, 2, True): {0: 0.9, 1: -1.0},\n",
       " (15, 2, True): {0: -0.6666666666666666, 1: -1.0},\n",
       " (6, 9, False): {0: -1.0, 1: -1.0},\n",
       " (16, 6, True): {0: -1.0, 1: 0.0},\n",
       " (20, 9, True): {0: 0.5, 1: 1.0},\n",
       " (11, 2, False): {0: -1.0, 1: 0.0},\n",
       " (7, 9, False): {0: -0.5, 1: -1.0},\n",
       " (17, 2, True): {0: -0.5, 1: 0.0},\n",
       " (6, 3, False): {0: -1.0, 1: -1.0},\n",
       " (13, 1, True): {0: -1.0, 1: -1.0},\n",
       " (18, 1, True): {0: 0.0, 1: -1.0},\n",
       " (5, 9, False): {0: -0.6666666666666666, 1: -1.0},\n",
       " (4, 1, False): {0: -1.0, 1: -0.3333333333333333},\n",
       " (9, 5, False): {0: -0.25, 1: -0.5},\n",
       " (17, 3, True): {0: 0.0, 1: -1.0},\n",
       " (13, 3, True): {0: -1.0, 1: 0.0},\n",
       " (12, 2, True): {0: 0.0, 1: -1.0},\n",
       " (14, 3, True): {0: -1.0, 1: 0.0},\n",
       " (12, 9, True): {0: 1.0, 1: -1.0},\n",
       " (5, 7, False): {0: -1.0, 1: -1.0},\n",
       " (8, 5, False): {0: 0.25, 1: -1.0},\n",
       " (14, 4, True): {0: -0.5, 1: 0.5},\n",
       " (20, 5, True): {0: 1.0, 1: -1.0},\n",
       " (13, 5, True): {0: 1.0, 1: 0},\n",
       " (16, 4, True): {0: 1.0, 1: -1.0},\n",
       " (5, 6, False): {0: 1.0, 1: 1.0},\n",
       " (4, 7, False): {0: 1.0, 1: 0.0},\n",
       " (19, 7, True): {0: 0.6, 1: 0.0},\n",
       " (17, 1, True): {0: -0.75, 1: -1.0},\n",
       " (20, 8, True): {0: 0.0, 1: -1.0},\n",
       " (14, 8, True): {0: 0.3333333333333333, 1: -1.0},\n",
       " (4, 10, False): {0: -0.3333333333333333, 1: 0},\n",
       " (20, 1, True): {0: 0.6666666666666666, 1: 0},\n",
       " (18, 6, True): {0: 0.3333333333333333, 1: -1.0},\n",
       " (18, 3, True): {0: 0.3333333333333333, 1: -0.75},\n",
       " (15, 9, True): {0: -1.0, 1: 0.3333333333333333},\n",
       " (16, 5, True): {0: -1.0, 1: -0.3333333333333333},\n",
       " (19, 8, True): {0: 1.0, 1: 0},\n",
       " (6, 5, False): {0: -0.3333333333333333, 1: 0},\n",
       " (12, 4, True): {0: 1.0, 1: 0.0},\n",
       " (4, 6, False): {0: 0, 1: 1.0},\n",
       " (13, 7, True): {0: -1.0, 1: -1.0},\n",
       " (18, 4, True): {0: -1.0, 1: 0.3333333333333333},\n",
       " (12, 6, True): {0: 1.0, 1: 0},\n",
       " (19, 5, True): {0: -1.0, 1: -1.0},\n",
       " (4, 4, False): {0: -1.0, 1: 0}}"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Q"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "efe06fb9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{(15,\n",
       "  2,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [-1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (13, 6, True): {0: [-1.0, 1.0, -1.0, -1.0, 1.0], 1: [-1.0]},\n",
       " (10, 1, False): {0: [-1.0, -1.0, -1.0, -1.0, -1.0],\n",
       "  1: [1.0, 1.0, 0.0, -1.0, -1.0, 1.0, 1.0, -1.0]},\n",
       " (9, 7, False): {0: [-1.0, -1.0, -1.0, -1.0, -1.0],\n",
       "  1: [-1.0, 1.0, -1.0, -1.0, -1.0, 1.0]},\n",
       " (19,\n",
       "  7,\n",
       "  False): {0: [1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [-1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (19,\n",
       "  10,\n",
       "  False): {0: [1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [-1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (12,\n",
       "  10,\n",
       "  False): {0: [1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0]},\n",
       " (15,\n",
       "  7,\n",
       "  False): {0: [1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (16,\n",
       "  10,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0]},\n",
       " (15, 1, True): {0: [-1.0, -1.0], 1: [-1.0, 0.0]},\n",
       " (12, 7, False): {0: [1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 1.0],\n",
       "  1: [1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0]},\n",
       " (5, 10, False): {0: [-1.0, -1.0, 1.0, -1.0, -1.0, -1.0],\n",
       "  1: [-1.0, -1.0, 1.0, -1.0, -1.0]},\n",
       " (15,\n",
       "  10,\n",
       "  False): {0: [-1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0], 1: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0]},\n",
       " (21,\n",
       "  8,\n",
       "  True): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [1.0, -1.0, -1.0, 1.0, 1.0, 1.0, 0.0, -1.0]},\n",
       " (20,\n",
       "  10,\n",
       "  False): {0: [0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (17,\n",
       "  10,\n",
       "  False): {0: [-1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (13,\n",
       "  1,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0]},\n",
       " (19,\n",
       "  1,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0], 1: [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (10, 6, False): {0: [1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0],\n",
       "  1: [-1.0, 1.0, 1.0, 1.0, 1.0, -1.0, 1.0, -1.0, 1.0]},\n",
       " (20,\n",
       "  6,\n",
       "  False): {0: [1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (11, 1, False): {0: [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],\n",
       "  1: [1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0]},\n",
       " (8,\n",
       "  10,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 1.0, -1.0, -1.0]},\n",
       " (11,\n",
       "  10,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0], 1: [1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (21,\n",
       "  10,\n",
       "  False): {0: [1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (10,\n",
       "  10,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0]},\n",
       " (14,\n",
       "  5,\n",
       "  False): {0: [-1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (20,\n",
       "  5,\n",
       "  False): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0], 1: [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 0.0, -1.0, -1.0]},\n",
       " (17, 4, True): {0: [1.0, 0.0, 0.0, -1.0, 1.0, -1.0],\n",
       "  1: [1.0, 0.0, 1.0, 1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (19, 4, True): {0: [1.0, -1.0, 1.0, 0.0, -1.0], 1: []},\n",
       " (20,\n",
       "  7,\n",
       "  False): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (8,\n",
       "  4,\n",
       "  False): {0: [-1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0, 1.0, -1.0]},\n",
       " (16,\n",
       "  4,\n",
       "  False): {0: [-1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 0.0, -1.0, -1.0, -1.0, 0.0]},\n",
       " (16,\n",
       "  8,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [-1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (20,\n",
       "  8,\n",
       "  False): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [-1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (13,\n",
       "  10,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (9,\n",
       "  10,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (9, 1, False): {0: [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],\n",
       "  1: [1.0, -1.0, 0.0, -1.0, 1.0, 0.0, -1.0, -1.0, 1.0]},\n",
       " (9, 4, False): {0: [1.0, -1.0, -1.0, -1.0, 1.0, -1.0],\n",
       "  1: [1.0, -1.0, 1.0, -1.0, -1.0, 1.0, 0.0, -1.0, -1.0, -1.0, 0.0]},\n",
       " (11,\n",
       "  4,\n",
       "  False): {0: [1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [1.0, -1.0, -1.0, 1.0, 1.0, 1.0]},\n",
       " (18,\n",
       "  4,\n",
       "  False): {0: [1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [-1.0, -1.0, 1.0, -1.0]},\n",
       " (17, 10, True): {0: [-1.0, 0.0, -1.0, -1.0],\n",
       "  1: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0]},\n",
       " (21,\n",
       "  10,\n",
       "  True): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0]},\n",
       " (18,\n",
       "  5,\n",
       "  False): {0: [0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0], 1: [-1.0, -1.0, -1.0, -1.0]},\n",
       " (14,\n",
       "  8,\n",
       "  False): {0: [1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (19,\n",
       "  8,\n",
       "  False): {0: [1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [-1.0, -1.0, -1.0, 1.0, -1.0]},\n",
       " (9,\n",
       "  3,\n",
       "  False): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: []},\n",
       " (20,\n",
       "  2,\n",
       "  False): {0: [0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (7, 3, False): {0: [1.0, 1.0, 1.0, -1.0, -1.0, 1.0, -1.0],\n",
       "  1: [-1.0, -1.0, 1.0, 1.0, -1.0, 0.0]},\n",
       " (16,\n",
       "  9,\n",
       "  False): {0: [1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [-1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 0.0, -1.0]},\n",
       " (12,\n",
       "  2,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [-1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (17,\n",
       "  9,\n",
       "  False): {0: [-1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0], 1: [-1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (10, 4, False): {0: [1.0, 1.0, 1.0, -1.0, 1.0, 1.0, 1.0, 1.0],\n",
       "  1: [1.0, 1.0, -1.0, -1.0, -1.0, 1.0, 1.0, 1.0]},\n",
       " (20,\n",
       "  4,\n",
       "  False): {0: [1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 1.0]},\n",
       " (13, 3, False): {0: [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0],\n",
       "  1: [-1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0]},\n",
       " (13, 7, False): {0: [-1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0],\n",
       "  1: [1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0]},\n",
       " (16,\n",
       "  7,\n",
       "  False): {0: [1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [-1.0, -1.0, -1.0, -1.0, 0.0, -1.0]},\n",
       " (13, 4, True): {0: [-1.0], 1: [1.0, -1.0, 1.0]},\n",
       " (14, 2, True): {0: [-1.0, -1.0, -1.0], 1: [1.0, -1.0, 1.0, -1.0, -1.0, -1.0]},\n",
       " (19, 2, True): {0: [1.0, 0.0, -1.0, 1.0, -1.0, 0.0, -1.0],\n",
       "  1: [1.0, -1.0, 0.0, 0.0]},\n",
       " (19,\n",
       "  2,\n",
       "  False): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0], 1: [-1.0, 0.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (18,\n",
       "  10,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (6, 4, False): {0: [-1.0, -1.0], 1: [1.0, 1.0, 1.0, -1.0]},\n",
       " (17,\n",
       "  5,\n",
       "  False): {0: [1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0, -1.0, 1.0, -1.0, -1.0, 0.0, -1.0]},\n",
       " (12, 1, False): {0: [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],\n",
       "  1: [-1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (20,\n",
       "  1,\n",
       "  False): {0: [1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0], 1: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (15,\n",
       "  6,\n",
       "  False): {0: [-1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [-1.0, 1.0, -1.0, -1.0, 1.0, -1.0]},\n",
       " (18,\n",
       "  6,\n",
       "  False): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0, -1.0, 1.0, -1.0]},\n",
       " (12, 8, False): {0: [1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0],\n",
       "  1: [1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (21,\n",
       "  8,\n",
       "  False): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [-1.0, -1.0, -1.0]},\n",
       " (15,\n",
       "  1,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (15,\n",
       "  5,\n",
       "  False): {0: [-1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [1.0, 1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (7,\n",
       "  10,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0]},\n",
       " (14,\n",
       "  10,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (15,\n",
       "  4,\n",
       "  False): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [-1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, 1.0, -1.0]},\n",
       " (12, 9, False): {0: [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],\n",
       "  1: [1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0]},\n",
       " (19,\n",
       "  9,\n",
       "  False): {0: [1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [-1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (16,\n",
       "  3,\n",
       "  False): {0: [1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0], 1: [-1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0]},\n",
       " (13,\n",
       "  8,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (19,\n",
       "  6,\n",
       "  False): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [-1.0, -1.0, -1.0]},\n",
       " (12, 10, True): {0: [1.0, -1.0, -1.0], 1: [1.0, -1.0, 1.0]},\n",
       " (13,\n",
       "  6,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0], 1: [-1.0, -1.0, 1.0, -1.0, 1.0, -1.0, -1.0, -1.0]},\n",
       " (19,\n",
       "  3,\n",
       "  False): {0: [1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (14,\n",
       "  1,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0, -1.0, -1.0, -1.0]},\n",
       " (17, 1, False): {0: [-1.0, -1.0, -1.0, 0.0, -1.0, -1.0, -1.0, -1.0],\n",
       "  1: [-1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0]},\n",
       " (12, 3, False): {0: [-1.0, -1.0, -1.0, 1.0, -1.0, -1.0],\n",
       "  1: [1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0]},\n",
       " (17,\n",
       "  3,\n",
       "  False): {0: [1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   0.0], 1: [1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0]},\n",
       " (18,\n",
       "  3,\n",
       "  False): {0: [1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0], 1: [-1.0, -1.0, 1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (14, 5, True): {0: [-1.0, -1.0, -1.0], 1: [-1.0, -1.0, 1.0, -1.0]},\n",
       " (10, 3, False): {0: [-1.0], 1: [1.0, 1.0, -1.0, 1.0, 1.0, 1.0, -1.0, -1.0]},\n",
       " (14,\n",
       "  3,\n",
       "  False): {0: [1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [1.0, 1.0, -1.0, 1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 0.0, -1.0]},\n",
       " (13,\n",
       "  5,\n",
       "  False): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [-1.0, 1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (4, 3, False): {0: [-1.0, -1.0], 1: [1.0, 1.0, 1.0]},\n",
       " (10, 5, False): {0: [1.0, -1.0, 1.0, 1.0], 1: [1.0, -1.0]},\n",
       " (12, 7, True): {0: [-1.0, -1.0, -1.0, 1.0, -1.0, -1.0], 1: [-1.0]},\n",
       " (21,\n",
       "  4,\n",
       "  True): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [-1.0, 1.0]},\n",
       " (21,\n",
       "  3,\n",
       "  True): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [1.0, -1.0]},\n",
       " (7, 8, False): {0: [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],\n",
       "  1: [-1.0, -1.0]},\n",
       " (11, 7, False): {0: [1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0],\n",
       "  1: [1.0, 1.0, 1.0, -1.0, -1.0, -1.0]},\n",
       " (8,\n",
       "  2,\n",
       "  False): {0: [1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [-1.0, -1.0]},\n",
       " (21,\n",
       "  2,\n",
       "  True): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [-1.0, 1.0]},\n",
       " (12,\n",
       "  6,\n",
       "  False): {0: [-1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (7, 5, False): {0: [1.0, -1.0, -1.0],\n",
       "  1: [0.0, 1.0, 1.0, -1.0, -1.0, 1.0, -1.0]},\n",
       " (21,\n",
       "  5,\n",
       "  True): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [1.0, 1.0, 1.0, 1.0, -1.0, -1.0, 1.0]},\n",
       " (5, 2, False): {0: [1.0, -1.0], 1: [-1.0, -1.0]},\n",
       " (9, 2, False): {0: [-1.0, -1.0],\n",
       "  1: [1.0, 1.0, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0, -1.0, 1.0]},\n",
       " (14, 1, True): {0: [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],\n",
       "  1: [-1.0, -1.0]},\n",
       " (17,\n",
       "  7,\n",
       "  False): {0: [-1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (7, 2, False): {0: [1.0, -1.0, 1.0, -1.0],\n",
       "  1: [1.0, 0.0, 1.0, 1.0, -1.0, -1.0, 1.0, 0.0]},\n",
       " (11,\n",
       "  6,\n",
       "  False): {0: [-1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0, 0.0, -1.0, 1.0, 1.0, 1.0]},\n",
       " (20,\n",
       "  10,\n",
       "  True): {0: [0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0], 1: [1.0, -1.0, 1.0]},\n",
       " (21,\n",
       "  1,\n",
       "  True): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0], 1: [1.0, -1.0, 0.0, 0.0, -1.0]},\n",
       " (21,\n",
       "  6,\n",
       "  True): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [-1.0, -1.0, -1.0, -1.0]},\n",
       " (14,\n",
       "  7,\n",
       "  False): {0: [-1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [-1.0, -1.0, -1.0, 0.0, -1.0, -1.0, -1.0]},\n",
       " (17,\n",
       "  8,\n",
       "  False): {0: [-1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [-1.0, -1.0, 1.0, -1.0, -1.0, -1.0]},\n",
       " (12,\n",
       "  5,\n",
       "  False): {0: [1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0], 1: [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (21, 5, False): {0: [1.0, 1.0, 1.0, 1.0, 1.0, 0.0], 1: [-1.0, -1.0, -1.0]},\n",
       " (19,\n",
       "  5,\n",
       "  False): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (15,\n",
       "  9,\n",
       "  False): {0: [-1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 0.0, -1.0, -1.0, -1.0]},\n",
       " (13, 9, False): {0: [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 1.0],\n",
       "  1: [-1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (21, 9, False): {0: [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],\n",
       "  1: [-1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (18,\n",
       "  2,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0], 1: [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (7, 6, False): {0: [1.0, 1.0, 1.0, 1.0, -1.0, -1.0, 1.0, -1.0],\n",
       "  1: [-1.0, 1.0, -1.0, -1.0]},\n",
       " (14,\n",
       "  2,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0]},\n",
       " (18,\n",
       "  7,\n",
       "  False): {0: [1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0], 1: [-1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (4, 8, False): {0: [-1.0, -1.0], 1: [1.0, 1.0]},\n",
       " (19, 1, True): {0: [1.0, 0.0, -1.0, -1.0, 1.0, -1.0, -1.0, 1.0], 1: [-1.0]},\n",
       " (8, 6, False): {0: [-1.0, -1.0, 1.0, 1.0],\n",
       "  1: [-1.0, 1.0, 0.0, -1.0, -1.0, 1.0]},\n",
       " (14,\n",
       "  4,\n",
       "  False): {0: [-1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [-1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (19,\n",
       "  4,\n",
       "  False): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0], 1: [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (17, 7, True): {0: [0.0], 1: [1.0, 1.0, 1.0, 1.0, 0.0, 1.0, -1.0, 1.0, -1.0]},\n",
       " (18, 7, True): {0: [1.0, 1.0, 1.0, 1.0, 0.0], 1: [-1.0]},\n",
       " (12, 5, True): {0: [], 1: [1.0, 1.0, -1.0]},\n",
       " (17, 5, True): {0: [1.0, -1.0, -1.0, -1.0], 1: [-1.0, 0.0]},\n",
       " (13,\n",
       "  10,\n",
       "  True): {0: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0, -1.0, -1.0, -1.0]},\n",
       " (15,\n",
       "  10,\n",
       "  True): {0: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [-1.0, 1.0, -1.0, -1.0, 1.0, 1.0, 1.0]},\n",
       " (11, 5, False): {0: [-1.0, -1.0, -1.0],\n",
       "  1: [1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0]},\n",
       " (18,\n",
       "  9,\n",
       "  False): {0: [-1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (21,\n",
       "  1,\n",
       "  False): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0], 1: [-1.0, -1.0]},\n",
       " (7, 4, False): {0: [1.0, -1.0, -1.0, 1.0, 1.0, -1.0, 1.0, -1.0],\n",
       "  1: [1.0, -1.0, 1.0, -1.0, -1.0]},\n",
       " (8, 1, False): {0: [-1.0, -1.0, -1.0],\n",
       "  1: [-1.0, 1.0, 1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 0.0, -1.0]},\n",
       " (16,\n",
       "  5,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0], 1: [-1.0, -1.0, -1.0, -1.0]},\n",
       " (20,\n",
       "  9,\n",
       "  False): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [-1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (8, 3, False): {0: [-1.0, 1.0, -1.0, -1.0, -1.0, 1.0, 1.0, 1.0, -1.0],\n",
       "  1: [-1.0, 1.0]},\n",
       " (17,\n",
       "  4,\n",
       "  False): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0], 1: [1.0, -1.0, -1.0, -1.0, 1.0]},\n",
       " (21, 4, False): {0: [1.0, 1.0, 1.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],\n",
       "  1: [-1.0, -1.0, -1.0]},\n",
       " (21, 6, False): {0: [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],\n",
       "  1: [-1.0, -1.0]},\n",
       " (21, 7, False): {0: [0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 1.0],\n",
       "  1: [-1.0, -1.0, -1.0]},\n",
       " (18,\n",
       "  8,\n",
       "  False): {0: [0.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0], 1: [-1.0, -1.0, 1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (18, 8, True): {0: [1.0, -1.0, 1.0, -1.0, 1.0], 1: [-1.0]},\n",
       " (21,\n",
       "  7,\n",
       "  True): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [1.0, 1.0, 1.0, -1.0, 0.0, 0.0]},\n",
       " (10, 8, False): {0: [-1.0, -1.0, 1.0, -1.0, 1.0, -1.0, -1.0],\n",
       "  1: [-1.0, 1.0, -1.0, 0.0, 1.0, 1.0, 1.0, 1.0, -1.0, -1.0, 1.0]},\n",
       " (15,\n",
       "  8,\n",
       "  False): {0: [1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 1.0, -1.0, -1.0]},\n",
       " (18, 5, True): {0: [-1.0, -1.0, -1.0, 1.0, 1.0, 1.0, -1.0], 1: [-1.0]},\n",
       " (17,\n",
       "  2,\n",
       "  False): {0: [1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   0.0], 1: [-1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 1.0]},\n",
       " (12,\n",
       "  4,\n",
       "  False): {0: [-1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (11, 8, False): {0: [-1.0, -1.0, -1.0],\n",
       "  1: [1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0]},\n",
       " (16, 9, True): {0: [-1.0], 1: [0.0, 1.0, -1.0, 1.0, 1.0]},\n",
       " (7, 7, False): {0: [-1.0, -1.0, 1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0],\n",
       "  1: [-1.0, -1.0]},\n",
       " (16,\n",
       "  2,\n",
       "  False): {0: [1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0]},\n",
       " (10, 2, False): {0: [-1.0, -1.0, 1.0, -1.0],\n",
       "  1: [0.0, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 1.0, 1.0]},\n",
       " (13,\n",
       "  2,\n",
       "  False): {0: [1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0]},\n",
       " (16,\n",
       "  1,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0, -1.0, -1.0, -1.0, -1.0, 1.0, 0.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (5, 1, False): {0: [-1.0, 1.0], 1: [-1.0, -1.0]},\n",
       " (6, 1, False): {0: [-1.0, -1.0, -1.0], 1: [-1.0, -1.0]},\n",
       " (5, 3, False): {0: [-1.0, -1.0], 1: [-1.0]},\n",
       " (11, 3, False): {0: [-1.0, 1.0, 1.0, -1.0, -1.0, -1.0, 1.0],\n",
       "  1: [-1.0, 1.0, 1.0, 0.0, -1.0, -1.0, 1.0, 1.0, 1.0, -1.0, -1.0, 1.0, -1.0]},\n",
       " (18,\n",
       "  10,\n",
       "  True): {0: [1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [0.0, -1.0, 0.0, -1.0, -1.0]},\n",
       " (5, 4, False): {0: [1.0], 1: [1.0]},\n",
       " (17,\n",
       "  6,\n",
       "  False): {0: [0.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [-1.0, -1.0, 0.0, 1.0]},\n",
       " (12, 1, True): {0: [-1.0], 1: [-1.0, 0.0, -1.0]},\n",
       " (9, 8, False): {0: [-1.0, -1.0, -1.0],\n",
       "  1: [-1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0]},\n",
       " (14, 9, True): {0: [-1.0, -1.0, -1.0, -1.0], 1: [-1.0]},\n",
       " (8, 9, False): {0: [-1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0],\n",
       "  1: [-1.0, 1.0, 0.0, 1.0]},\n",
       " (14,\n",
       "  10,\n",
       "  True): {0: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0, -1.0]},\n",
       " (15, 7, True): {0: [-1.0, -1.0, -1.0, -1.0], 1: [-1.0, -1.0, 1.0, 1.0, 1.0]},\n",
       " (4, 5, False): {0: [1.0, 1.0], 1: [-1.0]},\n",
       " (20,\n",
       "  3,\n",
       "  False): {0: [0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [-1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (21,\n",
       "  3,\n",
       "  False): {0: [0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [-1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (19, 6, True): {0: [-1.0], 1: [1.0, -1.0]},\n",
       " (13, 2, True): {0: [-1.0, -1.0, -1.0], 1: [1.0, -1.0, -1.0, 1.0, -1.0]},\n",
       " (15, 8, True): {0: [1.0, -1.0, -1.0], 1: [1.0, -1.0, -1.0]},\n",
       " (6, 2, False): {0: [1.0], 1: [-1.0]},\n",
       " (14,\n",
       "  9,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [0.0, 1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, 1.0, 1.0, -1.0, -1.0, 1.0, 1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (6,\n",
       "  10,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0]},\n",
       " (10,\n",
       "  7,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0], 1: [-1.0, -1.0, -1.0, -1.0]},\n",
       " (15, 3, True): {0: [1.0, -1.0, 1.0, -1.0, 1.0, -1.0], 1: [1.0]},\n",
       " (4, 9, False): {0: [-1.0, -1.0], 1: [-1.0]},\n",
       " (8, 7, False): {0: [1.0, -1.0, -1.0],\n",
       "  1: [0.0, 1.0, -1.0, 0.0, -1.0, 0.0, 0.0, 1.0, -1.0, 1.0, -1.0, -1.0]},\n",
       " (15,\n",
       "  3,\n",
       "  False): {0: [-1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0], 1: [0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (7, 1, False): {0: [-1.0, -1.0, -1.0, -1.0],\n",
       "  1: [-1.0, 0.0, -1.0, 1.0, 1.0, -1.0]},\n",
       " (11, 9, False): {0: [-1.0, -1.0, -1.0],\n",
       "  1: [1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0]},\n",
       " (13,\n",
       "  4,\n",
       "  False): {0: [-1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0]},\n",
       " (16, 2, True): {0: [1.0, -1.0, -1.0, 1.0, 1.0, 1.0, -1.0], 1: [-1.0, -1.0]},\n",
       " (16, 3, True): {0: [-1.0], 1: [1.0, 1.0, -1.0, -1.0, -1.0, -1.0, 1.0]},\n",
       " (19,\n",
       "  10,\n",
       "  True): {0: [1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [1.0, 0.0, -1.0, 0.0, -1.0, -1.0, -1.0]},\n",
       " (18,\n",
       "  1,\n",
       "  False): {0: [1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (10, 9, False): {0: [-1.0, -1.0, -1.0],\n",
       "  1: [1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0]},\n",
       " (15, 5, True): {0: [-1.0, 1.0, -1.0], 1: [-1.0, 1.0]},\n",
       " (16,\n",
       "  6,\n",
       "  False): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0], 1: [-1.0, -1.0, -1.0, 1.0, -1.0]},\n",
       " (17, 8, True): {0: [-1.0, 1.0, 0.0], 1: [-1.0]},\n",
       " (20, 3, True): {0: [1.0, 1.0, -1.0, 1.0, -1.0], 1: [-1.0]},\n",
       " (16, 1, True): {0: [-1.0, 1.0], 1: [-1.0, -1.0, -1.0]},\n",
       " (5, 5, False): {0: [-1.0, 1.0, 1.0, 1.0], 1: [-1.0, -1.0]},\n",
       " (21, 2, False): {0: [1.0, 1.0, 1.0, 0.0, 1.0, 1.0], 1: [-1.0, -1.0]},\n",
       " (19, 3, True): {0: [1.0, -1.0, 0.0, -1.0, 1.0, 1.0, 1.0], 1: [-1.0, -1.0]},\n",
       " (6, 7, False): {0: [1.0, -1.0, -1.0, -1.0], 1: [-1.0, -1.0]},\n",
       " (8, 8, False): {0: [-1.0, 1.0, 1.0, -1.0, 1.0, -1.0],\n",
       "  1: [-1.0, 1.0, 1.0, 1.0, -1.0, 1.0, 0.0, -1.0]},\n",
       " (6, 8, False): {0: [-1.0, -1.0, -1.0, -1.0, -1.0], 1: [-1.0, 1.0, -1.0]},\n",
       " (6, 6, False): {0: [-1.0], 1: [-1.0, 1.0, 1.0, 1.0, -1.0, -1.0, -1.0]},\n",
       " (15, 6, True): {0: [1.0], 1: [1.0, 1.0, 1.0, -1.0]},\n",
       " (17, 9, True): {0: [1.0, 1.0, 1.0, -1.0], 1: [1.0, -1.0]},\n",
       " (18, 9, True): {0: [-1.0], 1: [1.0, -1.0, -1.0, -1.0]},\n",
       " (18, 2, True): {0: [], 1: [1.0, -1.0, 0.0]},\n",
       " (9, 6, False): {0: [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, -1.0, 1.0, 1.0, -1.0],\n",
       "  1: [1.0, -1.0, -1.0, 1.0]},\n",
       " (9, 9, False): {0: [-1.0, -1.0, -1.0, 1.0, 1.0],\n",
       "  1: [1.0, -1.0, 1.0, 1.0, -1.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0]},\n",
       " (17, 6, True): {0: [1.0, 1.0, -1.0, 1.0, -1.0], 1: []},\n",
       " (12, 8, True): {0: [-1.0], 1: [1.0]},\n",
       " (14, 7, True): {0: [-1.0], 1: [-1.0, 1.0, -1.0, 1.0]},\n",
       " (16, 7, True): {0: [1.0, -1.0, 1.0, -1.0, 1.0, -1.0], 1: [0.0, -1.0, -1.0]},\n",
       " (19, 9, True): {0: [-1.0, 0.0, 1.0, 1.0, 1.0, 1.0], 1: [-1.0]},\n",
       " (14, 6, True): {0: [1.0, -1.0], 1: [1.0, 1.0, 1.0, -1.0]},\n",
       " (12, 3, True): {0: [-1.0, 1.0], 1: [-1.0]},\n",
       " (14,\n",
       "  6,\n",
       "  False): {0: [-1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0], 1: [-1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   0.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0,\n",
       "   -1.0]},\n",
       " (21,\n",
       "  9,\n",
       "  True): {0: [1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0,\n",
       "   1.0], 1: [-1.0, 1.0, 1.0]},\n",
       " (16, 10, True): {0: [-1.0, -1.0, -1.0, -1.0],\n",
       "  1: [1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0]},\n",
       " (15, 4, True): {0: [-1.0], 1: [0.0, 0.0, -1.0]},\n",
       " (20, 7, True): {0: [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],\n",
       "  1: [1.0, 1.0, 1.0, 0.0]},\n",
       " (20, 6, True): {0: [1.0, 1.0, -1.0, 1.0], 1: [-1.0]},\n",
       " (20, 4, True): {0: [-1.0], 1: [1.0, 1.0, 1.0, -1.0, 1.0, 1.0, 1.0]},\n",
       " (13, 8, True): {0: [1.0, -1.0, -1.0], 1: [-1.0, 1.0]},\n",
       " (20, 2, True): {0: [1.0, 1.0, 1.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],\n",
       "  1: [-1.0]},\n",
       " (15, 2, True): {0: [-1.0, -1.0, 1.0, -1.0, -1.0, -1.0], 1: [-1.0]},\n",
       " (6, 9, False): {0: [-1.0, -1.0, -1.0, -1.0], 1: [-1.0, -1.0]},\n",
       " (16, 6, True): {0: [-1.0], 1: [1.0, -1.0, -1.0, 1.0]},\n",
       " (20, 9, True): {0: [1.0, -1.0, 1.0, 1.0], 1: [1.0]},\n",
       " (11, 2, False): {0: [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],\n",
       "  1: [-1.0, 1.0, -1.0, -1.0, 1.0, 0.0, 1.0, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0]},\n",
       " (7, 9, False): {0: [-1.0, -1.0, -1.0, 1.0, 1.0, -1.0, -1.0, -1.0], 1: [-1.0]},\n",
       " (17, 2, True): {0: [0.0, -1.0], 1: [1.0, -1.0]},\n",
       " (6, 3, False): {0: [-1.0, -1.0, -1.0, -1.0], 1: [-1.0, -1.0]},\n",
       " (13, 1, True): {0: [-1.0, -1.0, -1.0, -1.0], 1: [-1.0, -1.0]},\n",
       " (18, 1, True): {0: [1.0, 0.0, -1.0], 1: [-1.0]},\n",
       " (5, 9, False): {0: [-1.0, -1.0, 1.0, -1.0, -1.0, -1.0],\n",
       "  1: [-1.0, -1.0, -1.0]},\n",
       " (4, 1, False): {0: [-1.0, -1.0], 1: [1.0, -1.0, -1.0]},\n",
       " (9, 5, False): {0: [-1.0, 1.0, 1.0, -1.0, -1.0, -1.0, 1.0, -1.0],\n",
       "  1: [-1.0, 1.0, -1.0, -1.0]},\n",
       " (17, 3, True): {0: [-1.0, 1.0], 1: [-1.0, -1.0, -1.0]},\n",
       " (13, 3, True): {0: [-1.0], 1: [0.0]},\n",
       " (12, 2, True): {0: [-1.0, 1.0], 1: [-1.0]},\n",
       " (14, 3, True): {0: [-1.0, -1.0, -1.0], 1: [1.0, -1.0, -1.0, 1.0]},\n",
       " (12, 9, True): {0: [1.0], 1: [-1.0]},\n",
       " (5, 7, False): {0: [-1.0, -1.0], 1: [-1.0]},\n",
       " (8, 5, False): {0: [1.0, -1.0, 1.0, 1.0, 1.0, -1.0, -1.0, 1.0], 1: [-1.0]},\n",
       " (14, 4, True): {0: [1.0, -1.0, -1.0, -1.0], 1: [1.0, 1.0, -1.0, 1.0]},\n",
       " (20, 5, True): {0: [1.0, 1.0, 1.0, 1.0], 1: [-1.0]},\n",
       " (13, 5, True): {0: [1.0], 1: []},\n",
       " (16, 4, True): {0: [1.0, 1.0], 1: [-1.0]},\n",
       " (5, 6, False): {0: [1.0, 1.0], 1: [1.0]},\n",
       " (4, 7, False): {0: [1.0], 1: [-1.0, 1.0]},\n",
       " (19, 7, True): {0: [1.0, 1.0, 1.0, -1.0, 1.0], 1: [0.0]},\n",
       " (17, 1, True): {0: [0.0, -1.0, -1.0, -1.0], 1: [-1.0]},\n",
       " (20, 8, True): {0: [1.0, -1.0, -1.0, 1.0], 1: [-1.0]},\n",
       " (14, 8, True): {0: [-1.0, 1.0, 1.0], 1: [-1.0]},\n",
       " (4, 10, False): {0: [1.0, -1.0, -1.0], 1: []},\n",
       " (20, 1, True): {0: [1.0, 1.0, 0.0], 1: []},\n",
       " (18, 6, True): {0: [1.0, 1.0, -1.0], 1: [-1.0, -1.0]},\n",
       " (18, 3, True): {0: [-1.0, 1.0, 1.0, 1.0, -1.0, 1.0],\n",
       "  1: [-1.0, -1.0, -1.0, 0.0]},\n",
       " (15, 9, True): {0: [-1.0], 1: [1.0, -1.0, 1.0]},\n",
       " (16, 5, True): {0: [-1.0], 1: [-1.0, 1.0, -1.0]},\n",
       " (19, 8, True): {0: [1.0, 1.0, 1.0, 1.0], 1: []},\n",
       " (6, 5, False): {0: [1.0, -1.0, -1.0], 1: []},\n",
       " (12, 4, True): {0: [1.0, 1.0], 1: [-1.0, 1.0]},\n",
       " (4, 6, False): {0: [], 1: [1.0, 1.0]},\n",
       " (13, 7, True): {0: [-1.0, -1.0], 1: [-1.0, -1.0]},\n",
       " (18, 4, True): {0: [-1.0], 1: [1.0, -1.0, 1.0]},\n",
       " (12, 6, True): {0: [1.0], 1: []},\n",
       " (19, 5, True): {0: [-1.0], 1: [-1.0]},\n",
       " (4, 4, False): {0: [-1.0], 1: []}}"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rewards"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "a446d28f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-1318.0\n"
     ]
    }
   ],
   "source": [
    "# 总奖励\n",
    "total_rewards = 0\n",
    "for k,v in rewards.items():\n",
    "    total_rewards += sum(v[0])\n",
    "    total_rewards += sum(v[1])\n",
    "print(total_rewards)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "ccdc4144",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{(15, 2, False): [0.2, 0.8],\n",
       " (13, 6, True): [0.8, 0.2],\n",
       " (10, 1, False): [0.2, 0.8],\n",
       " (9, 7, False): [0.2, 0.8],\n",
       " (19, 7, False): [0.8, 0.2],\n",
       " (19, 10, False): [0.8, 0.2],\n",
       " (12, 10, False): [0.2, 0.8],\n",
       " (15, 7, False): [0.8, 0.2],\n",
       " (16, 10, False): [0.8, 0.2],\n",
       " (15, 1, True): [0.2, 0.8],\n",
       " (12, 7, False): [0.2, 0.8],\n",
       " (5, 10, False): [0.2, 0.8],\n",
       " (15, 10, False): [0.8, 0.2],\n",
       " (21, 8, True): [0.8, 0.2],\n",
       " (20, 10, False): [0.8, 0.2],\n",
       " (17, 10, False): [0.8, 0.2],\n",
       " (13, 1, False): [0.2, 0.8],\n",
       " (19, 1, False): [0.8, 0.2],\n",
       " (10, 6, False): [0.2, 0.8],\n",
       " (20, 6, False): [0.8, 0.2],\n",
       " (11, 1, False): [0.2, 0.8],\n",
       " (8, 10, False): [0.8, 0.2],\n",
       " (11, 10, False): [0.2, 0.8],\n",
       " (21, 10, False): [0.8, 0.2],\n",
       " (10, 10, False): [0.2, 0.8],\n",
       " (14, 5, False): [0.8, 0.2],\n",
       " (20, 5, False): [0.8, 0.2],\n",
       " (17, 4, True): [0.8, 0.2],\n",
       " (19, 4, True): [0.8, 0.2],\n",
       " (20, 7, False): [0.8, 0.2],\n",
       " (8, 4, False): [0.8, 0.2],\n",
       " (16, 4, False): [0.8, 0.2],\n",
       " (16, 8, False): [0.8, 0.2],\n",
       " (20, 8, False): [0.8, 0.2],\n",
       " (13, 10, False): [0.8, 0.2],\n",
       " (9, 10, False): [0.2, 0.8],\n",
       " (9, 1, False): [0.2, 0.8],\n",
       " (9, 4, False): [0.2, 0.8],\n",
       " (11, 4, False): [0.2, 0.8],\n",
       " (18, 4, False): [0.8, 0.2],\n",
       " (17, 10, True): [0.2, 0.8],\n",
       " (21, 10, True): [0.8, 0.2],\n",
       " (18, 5, False): [0.8, 0.2],\n",
       " (14, 8, False): [0.2, 0.8],\n",
       " (19, 8, False): [0.8, 0.2],\n",
       " (9, 3, False): [0.8, 0.2],\n",
       " (20, 2, False): [0.8, 0.2],\n",
       " (7, 3, False): [0.8, 0.2],\n",
       " (16, 9, False): [0.8, 0.2],\n",
       " (12, 2, False): [0.8, 0.2],\n",
       " (17, 9, False): [0.8, 0.2],\n",
       " (10, 4, False): [0.8, 0.2],\n",
       " (20, 4, False): [0.8, 0.2],\n",
       " (13, 3, False): [0.2, 0.8],\n",
       " (13, 7, False): [0.2, 0.8],\n",
       " (16, 7, False): [0.8, 0.2],\n",
       " (13, 4, True): [0.2, 0.8],\n",
       " (14, 2, True): [0.2, 0.8],\n",
       " (19, 2, True): [0.2, 0.8],\n",
       " (19, 2, False): [0.8, 0.2],\n",
       " (18, 10, False): [0.8, 0.2],\n",
       " (6, 4, False): [0.2, 0.8],\n",
       " (17, 5, False): [0.8, 0.2],\n",
       " (12, 1, False): [0.2, 0.8],\n",
       " (20, 1, False): [0.8, 0.2],\n",
       " (15, 6, False): [0.8, 0.2],\n",
       " (18, 6, False): [0.8, 0.2],\n",
       " (12, 8, False): [0.2, 0.8],\n",
       " (21, 8, False): [0.8, 0.2],\n",
       " (15, 1, False): [0.8, 0.2],\n",
       " (15, 5, False): [0.8, 0.2],\n",
       " (7, 10, False): [0.2, 0.8],\n",
       " (14, 10, False): [0.8, 0.2],\n",
       " (15, 4, False): [0.8, 0.2],\n",
       " (12, 9, False): [0.2, 0.8],\n",
       " (19, 9, False): [0.8, 0.2],\n",
       " (16, 3, False): [0.2, 0.8],\n",
       " (13, 8, False): [0.2, 0.8],\n",
       " (19, 6, False): [0.8, 0.2],\n",
       " (12, 10, True): [0.2, 0.8],\n",
       " (13, 6, False): [0.8, 0.2],\n",
       " (19, 3, False): [0.8, 0.2],\n",
       " (14, 1, False): [0.8, 0.2],\n",
       " (17, 1, False): [0.2, 0.8],\n",
       " (12, 3, False): [0.2, 0.8],\n",
       " (17, 3, False): [0.8, 0.2],\n",
       " (18, 3, False): [0.8, 0.2],\n",
       " (14, 5, True): [0.2, 0.8],\n",
       " (10, 3, False): [0.2, 0.8],\n",
       " (14, 3, False): [0.8, 0.2],\n",
       " (13, 5, False): [0.8, 0.2],\n",
       " (4, 3, False): [0.2, 0.8],\n",
       " (10, 5, False): [0.8, 0.2],\n",
       " (12, 7, True): [0.8, 0.2],\n",
       " (21, 4, True): [0.8, 0.2],\n",
       " (21, 3, True): [0.8, 0.2],\n",
       " (7, 8, False): [0.8, 0.2],\n",
       " (11, 7, False): [0.2, 0.8],\n",
       " (8, 2, False): [0.8, 0.2],\n",
       " (21, 2, True): [0.8, 0.2],\n",
       " (12, 6, False): [0.8, 0.2],\n",
       " (7, 5, False): [0.2, 0.8],\n",
       " (21, 5, True): [0.8, 0.2],\n",
       " (5, 2, False): [0.8, 0.2],\n",
       " (9, 2, False): [0.2, 0.8],\n",
       " (14, 1, True): [0.8, 0.2],\n",
       " (17, 7, False): [0.8, 0.2],\n",
       " (7, 2, False): [0.2, 0.8],\n",
       " (11, 6, False): [0.2, 0.8],\n",
       " (20, 10, True): [0.2, 0.8],\n",
       " (21, 1, True): [0.8, 0.2],\n",
       " (21, 6, True): [0.8, 0.2],\n",
       " (14, 7, False): [0.8, 0.2],\n",
       " (17, 8, False): [0.8, 0.2],\n",
       " (12, 5, False): [0.8, 0.2],\n",
       " (21, 5, False): [0.8, 0.2],\n",
       " (19, 5, False): [0.8, 0.2],\n",
       " (15, 9, False): [0.8, 0.2],\n",
       " (13, 9, False): [0.2, 0.8],\n",
       " (21, 9, False): [0.8, 0.2],\n",
       " (18, 2, False): [0.8, 0.2],\n",
       " (7, 6, False): [0.8, 0.2],\n",
       " (14, 2, False): [0.2, 0.8],\n",
       " (18, 7, False): [0.8, 0.2],\n",
       " (4, 8, False): [0.2, 0.8],\n",
       " (19, 1, True): [0.8, 0.2],\n",
       " (8, 6, False): [0.8, 0.2],\n",
       " (14, 4, False): [0.8, 0.2],\n",
       " (19, 4, False): [0.8, 0.2],\n",
       " (17, 7, True): [0.2, 0.8],\n",
       " (18, 7, True): [0.8, 0.2],\n",
       " (12, 5, True): [0.2, 0.8],\n",
       " (17, 5, True): [0.8, 0.2],\n",
       " (13, 10, True): [0.8, 0.2],\n",
       " (15, 10, True): [0.2, 0.8],\n",
       " (11, 5, False): [0.2, 0.8],\n",
       " (18, 9, False): [0.8, 0.2],\n",
       " (21, 1, False): [0.8, 0.2],\n",
       " (7, 4, False): [0.8, 0.2],\n",
       " (8, 1, False): [0.2, 0.8],\n",
       " (16, 5, False): [0.8, 0.2],\n",
       " (20, 9, False): [0.8, 0.2],\n",
       " (8, 3, False): [0.2, 0.8],\n",
       " (17, 4, False): [0.8, 0.2],\n",
       " (21, 4, False): [0.8, 0.2],\n",
       " (21, 6, False): [0.8, 0.2],\n",
       " (21, 7, False): [0.8, 0.2],\n",
       " (18, 8, False): [0.8, 0.2],\n",
       " (18, 8, True): [0.8, 0.2],\n",
       " (21, 7, True): [0.8, 0.2],\n",
       " (10, 8, False): [0.2, 0.8],\n",
       " (15, 8, False): [0.8, 0.2],\n",
       " (18, 5, True): [0.8, 0.2],\n",
       " (17, 2, False): [0.8, 0.2],\n",
       " (12, 4, False): [0.2, 0.8],\n",
       " (11, 8, False): [0.2, 0.8],\n",
       " (16, 9, True): [0.2, 0.8],\n",
       " (7, 7, False): [0.8, 0.2],\n",
       " (16, 2, False): [0.8, 0.2],\n",
       " (10, 2, False): [0.2, 0.8],\n",
       " (13, 2, False): [0.8, 0.2],\n",
       " (16, 1, False): [0.8, 0.2],\n",
       " (5, 1, False): [0.8, 0.2],\n",
       " (6, 1, False): [0.8, 0.2],\n",
       " (5, 3, False): [0.8, 0.2],\n",
       " (11, 3, False): [0.2, 0.8],\n",
       " (18, 10, True): [0.8, 0.2],\n",
       " (5, 4, False): [0.8, 0.2],\n",
       " (17, 6, False): [0.8, 0.2],\n",
       " (12, 1, True): [0.2, 0.8],\n",
       " (9, 8, False): [0.2, 0.8],\n",
       " (14, 9, True): [0.8, 0.2],\n",
       " (8, 9, False): [0.2, 0.8],\n",
       " (14, 10, True): [0.8, 0.2],\n",
       " (15, 7, True): [0.2, 0.8],\n",
       " (4, 5, False): [0.8, 0.2],\n",
       " (20, 3, False): [0.8, 0.2],\n",
       " (21, 3, False): [0.8, 0.2],\n",
       " (19, 6, True): [0.2, 0.8],\n",
       " (13, 2, True): [0.2, 0.8],\n",
       " (15, 8, True): [0.8, 0.2],\n",
       " (6, 2, False): [0.8, 0.2],\n",
       " (14, 9, False): [0.2, 0.8],\n",
       " (6, 10, False): [0.8, 0.2],\n",
       " (10, 7, False): [0.8, 0.2],\n",
       " (15, 3, True): [0.2, 0.8],\n",
       " (4, 9, False): [0.8, 0.2],\n",
       " (8, 7, False): [0.2, 0.8],\n",
       " (15, 3, False): [0.8, 0.2],\n",
       " (7, 1, False): [0.2, 0.8],\n",
       " (11, 9, False): [0.2, 0.8],\n",
       " (13, 4, False): [0.2, 0.8],\n",
       " (16, 2, True): [0.8, 0.2],\n",
       " (16, 3, True): [0.2, 0.8],\n",
       " (19, 10, True): [0.8, 0.2],\n",
       " (18, 1, False): [0.8, 0.2],\n",
       " (10, 9, False): [0.2, 0.8],\n",
       " (15, 5, True): [0.2, 0.8],\n",
       " (16, 6, False): [0.8, 0.2],\n",
       " (17, 8, True): [0.8, 0.2],\n",
       " (20, 3, True): [0.8, 0.2],\n",
       " (16, 1, True): [0.8, 0.2],\n",
       " (5, 5, False): [0.8, 0.2],\n",
       " (21, 2, False): [0.8, 0.2],\n",
       " (19, 3, True): [0.8, 0.2],\n",
       " (6, 7, False): [0.8, 0.2],\n",
       " (8, 8, False): [0.2, 0.8],\n",
       " (6, 8, False): [0.2, 0.8],\n",
       " (6, 6, False): [0.2, 0.8],\n",
       " (15, 6, True): [0.8, 0.2],\n",
       " (17, 9, True): [0.8, 0.2],\n",
       " (18, 9, True): [0.2, 0.8],\n",
       " (18, 2, True): [0.8, 0.2],\n",
       " (9, 6, False): [0.8, 0.2],\n",
       " (9, 9, False): [0.2, 0.8],\n",
       " (17, 6, True): [0.8, 0.2],\n",
       " (12, 8, True): [0.2, 0.8],\n",
       " (14, 7, True): [0.2, 0.8],\n",
       " (16, 7, True): [0.8, 0.2],\n",
       " (19, 9, True): [0.8, 0.2],\n",
       " (14, 6, True): [0.2, 0.8],\n",
       " (12, 3, True): [0.8, 0.2],\n",
       " (14, 6, False): [0.2, 0.8],\n",
       " (21, 9, True): [0.8, 0.2],\n",
       " (16, 10, True): [0.2, 0.8],\n",
       " (15, 4, True): [0.2, 0.8],\n",
       " (20, 7, True): [0.8, 0.2],\n",
       " (20, 6, True): [0.8, 0.2],\n",
       " (20, 4, True): [0.2, 0.8],\n",
       " (13, 8, True): [0.2, 0.8],\n",
       " (20, 2, True): [0.8, 0.2],\n",
       " (15, 2, True): [0.8, 0.2],\n",
       " (6, 9, False): [0.8, 0.2],\n",
       " (16, 6, True): [0.2, 0.8],\n",
       " (20, 9, True): [0.2, 0.8],\n",
       " (11, 2, False): [0.2, 0.8],\n",
       " (7, 9, False): [0.8, 0.2],\n",
       " (17, 2, True): [0.2, 0.8],\n",
       " (6, 3, False): [0.8, 0.2],\n",
       " (13, 1, True): [0.8, 0.2],\n",
       " (18, 1, True): [0.8, 0.2],\n",
       " (5, 9, False): [0.8, 0.2],\n",
       " (4, 1, False): [0.2, 0.8],\n",
       " (9, 5, False): [0.8, 0.2],\n",
       " (17, 3, True): [0.8, 0.2],\n",
       " (13, 3, True): [0.2, 0.8],\n",
       " (12, 2, True): [0.8, 0.2],\n",
       " (14, 3, True): [0.2, 0.8],\n",
       " (12, 9, True): [0.8, 0.2],\n",
       " (5, 7, False): [0.8, 0.2],\n",
       " (8, 5, False): [0.8, 0.2],\n",
       " (14, 4, True): [0.2, 0.8],\n",
       " (20, 5, True): [0.8, 0.2],\n",
       " (13, 5, True): [0.8, 0.2],\n",
       " (16, 4, True): [0.8, 0.2],\n",
       " (5, 6, False): [0.8, 0.2],\n",
       " (4, 7, False): [0.8, 0.2],\n",
       " (19, 7, True): [0.8, 0.2],\n",
       " (17, 1, True): [0.8, 0.2],\n",
       " (20, 8, True): [0.8, 0.2],\n",
       " (14, 8, True): [0.8, 0.2],\n",
       " (4, 10, False): [0.2, 0.8],\n",
       " (20, 1, True): [0.8, 0.2],\n",
       " (18, 6, True): [0.8, 0.2],\n",
       " (18, 3, True): [0.8, 0.2],\n",
       " (15, 9, True): [0.2, 0.8],\n",
       " (16, 5, True): [0.2, 0.8],\n",
       " (19, 8, True): [0.8, 0.2],\n",
       " (6, 5, False): [0.2, 0.8],\n",
       " (12, 4, True): [0.8, 0.2],\n",
       " (4, 6, False): [0.2, 0.8],\n",
       " (13, 7, True): [0.8, 0.2],\n",
       " (18, 4, True): [0.2, 0.8],\n",
       " (12, 6, True): [0.8, 0.2],\n",
       " (19, 5, True): [0.8, 0.2],\n",
       " (4, 4, False): [0.2, 0.8]}"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "policy"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e308dbfb",
   "metadata": {},
   "source": [
    "## 时序差分方法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "f56b9e61",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 初始化Q值表，用于存储Q(state,action)\n",
    "Q = {}\n",
    "explore_rate = 0.2 # 探索率为0.2\n",
    "policy = {} # 创建空字典作为策略表，存储在状态s下选择动作a的概率\n",
    "rewards = {} # 创建空字典用于保存(state,action)对的累积奖励\n",
    "num_episodes = 5000 # 总回合数\n",
    "alpha = 0.1  # 学习率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "6554e4c6",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 生成回合\n",
    "def generate_episode(Q,policy):\n",
    "    #回合观测序列列表\n",
    "    episode = []\n",
    "    # 初始化环境并获取初始状态\n",
    "    state, _ = env.reset()\n",
    "    while True:\n",
    "        # 若状态s第一次出现，将它添加到Q和policy中\n",
    "        if state not in Q.keys():\n",
    "            Q[state] = {0:0, 1:0} #初始化stick和hit的Q值\n",
    "            policy[state] = [0.5, 0.5] #初始化stick和hit的概率，各为0.5\n",
    "            rewards[state] = {0:[] , 1: []} #初始化空列表用于存储累积奖励\n",
    "        # 利用policy采样一个动作\n",
    "        action = np.random.choice([0,1], p=policy[state],size=1)[0]\n",
    "        #与环境交互，产生奖励与下一状态\n",
    "        next_state, reward, terminated, truncated, info = env.step(action)\n",
    "        #将状态state、动作action、奖励reward添加到episode中\n",
    "        episode.append((state, action, reward, next_state))\n",
    "        #到达终止状态，循环结束\n",
    "        if terminated:\n",
    "            break\n",
    "        state = next_state\n",
    "    return episode"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "ad2e0fac",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 开始学习\n",
    "for i in range(num_episodes):\n",
    "    #产生一个观测序列，包括该回合每一步的state,action, reward\n",
    "    episode = generate_episode(Q, policy)\n",
    "    #初始化该回合累积奖励\n",
    "    episode_sum_reward = 0.0\n",
    "    #反向遍历观测序列中的每一步\n",
    "    for t in range(len(episode)):\n",
    "        #分别保存每一步的状态、动作和奖励\n",
    "        state ,action, reward, next_state = episode[t]\n",
    "        if next_state not in Q.keys():\n",
    "            Q[next_state] = {0: 0.0, 1: 0.0}\n",
    "        #计算累积奖励\n",
    "        episode_sum_reward += reward\n",
    "        #将episode_sum_reward加入（state，action）的rewards中\n",
    "        rewards[state][action].append(episode_sum_reward)\n",
    "        # TD（0）方式更新Q表中的Q值\n",
    "        Q[state][action] += alpha * (reward + max(Q[next_state].values()) - Q[state][action])\n",
    "        # 更新策略\n",
    "        policy_action = np.argmax(list(Q[state].values()))\n",
    "        policy[state][policy_action] = 1 - explore_rate\n",
    "        policy[state][1 - policy_action] = explore_rate"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "4f3285a5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{(20, 10, False): [0.8, 0.2],\n",
       " (12, 10, False): [0.2, 0.8],\n",
       " (15, 8, False): [0.2, 0.8],\n",
       " (19, 8, False): [0.8, 0.2],\n",
       " (20, 6, False): [0.8, 0.2],\n",
       " (21, 6, False): [0.8, 0.2],\n",
       " (12, 6, True): [0.8, 0.2],\n",
       " (16, 6, True): [0.2, 0.8],\n",
       " (20, 6, True): [0.8, 0.2],\n",
       " (21, 6, True): [0.8, 0.2],\n",
       " (7, 10, False): [0.2, 0.8],\n",
       " (14, 6, False): [0.2, 0.8],\n",
       " (7, 5, False): [0.8, 0.2],\n",
       " (11, 5, False): [0.2, 0.8],\n",
       " (21, 5, False): [0.8, 0.2],\n",
       " (13, 2, False): [0.2, 0.8],\n",
       " (10, 5, False): [0.2, 0.8],\n",
       " (15, 2, False): [0.2, 0.8],\n",
       " (16, 2, False): [0.2, 0.8],\n",
       " (17, 10, False): [0.2, 0.8],\n",
       " (13, 3, True): [0.2, 0.8],\n",
       " (20, 3, True): [0.8, 0.2],\n",
       " (17, 7, True): [0.2, 0.8],\n",
       " (6, 3, False): [0.2, 0.8],\n",
       " (18, 10, False): [0.2, 0.8],\n",
       " (18, 3, False): [0.8, 0.2],\n",
       " (9, 3, False): [0.8, 0.2],\n",
       " (9, 5, False): [0.2, 0.8],\n",
       " (19, 5, False): [0.8, 0.2],\n",
       " (12, 4, True): [0.2, 0.8],\n",
       " (14, 4, True): [0.2, 0.8],\n",
       " (19, 10, False): [0.2, 0.8],\n",
       " (7, 1, False): [0.2, 0.8],\n",
       " (17, 4, False): [0.8, 0.2],\n",
       " (8, 10, False): [0.2, 0.8],\n",
       " (4, 10, False): [0.2, 0.8],\n",
       " (15, 3, False): [0.8, 0.2],\n",
       " (19, 1, False): [0.2, 0.8],\n",
       " (18, 8, False): [0.8, 0.2],\n",
       " (21, 10, False): [0.8, 0.2],\n",
       " (17, 8, True): [0.2, 0.8],\n",
       " (17, 8, False): [0.2, 0.8],\n",
       " (7, 3, False): [0.2, 0.8],\n",
       " (20, 9, False): [0.8, 0.2],\n",
       " (12, 2, False): [0.2, 0.8],\n",
       " (10, 1, False): [0.2, 0.8],\n",
       " (20, 1, False): [0.8, 0.2],\n",
       " (14, 4, False): [0.2, 0.8],\n",
       " (14, 10, False): [0.2, 0.8],\n",
       " (19, 3, False): [0.8, 0.2],\n",
       " (9, 7, False): [0.2, 0.8],\n",
       " (17, 7, False): [0.2, 0.8],\n",
       " (21, 7, False): [0.8, 0.2],\n",
       " (10, 10, False): [0.2, 0.8],\n",
       " (17, 2, False): [0.8, 0.2],\n",
       " (13, 10, False): [0.2, 0.8],\n",
       " (15, 10, False): [0.2, 0.8],\n",
       " (21, 1, True): [0.8, 0.2],\n",
       " (9, 10, False): [0.2, 0.8],\n",
       " (12, 1, False): [0.2, 0.8],\n",
       " (16, 10, True): [0.2, 0.8],\n",
       " (19, 7, False): [0.8, 0.2],\n",
       " (20, 2, False): [0.8, 0.2],\n",
       " (21, 3, True): [0.8, 0.2],\n",
       " (12, 6, False): [0.2, 0.8],\n",
       " (12, 5, False): [0.8, 0.2],\n",
       " (13, 5, False): [0.2, 0.8],\n",
       " (14, 5, False): [0.2, 0.8],\n",
       " (15, 4, False): [0.2, 0.8],\n",
       " (11, 1, False): [0.2, 0.8],\n",
       " (20, 4, False): [0.8, 0.2],\n",
       " (13, 4, False): [0.2, 0.8],\n",
       " (9, 1, False): [0.8, 0.2],\n",
       " (19, 9, False): [0.8, 0.2],\n",
       " (14, 1, False): [0.2, 0.8],\n",
       " (13, 9, False): [0.2, 0.8],\n",
       " (13, 6, False): [0.2, 0.8],\n",
       " (16, 9, False): [0.2, 0.8],\n",
       " (8, 7, False): [0.2, 0.8],\n",
       " (21, 2, True): [0.8, 0.2],\n",
       " (12, 8, False): [0.2, 0.8],\n",
       " (16, 10, False): [0.2, 0.8],\n",
       " (17, 1, False): [0.2, 0.8],\n",
       " (18, 1, False): [0.2, 0.8],\n",
       " (14, 2, False): [0.2, 0.8],\n",
       " (14, 2, True): [0.2, 0.8],\n",
       " (17, 2, True): [0.2, 0.8],\n",
       " (21, 2, False): [0.8, 0.2],\n",
       " (11, 6, False): [0.2, 0.8],\n",
       " (8, 6, False): [0.2, 0.8],\n",
       " (14, 3, False): [0.2, 0.8],\n",
       " (20, 8, False): [0.8, 0.2],\n",
       " (15, 5, False): [0.2, 0.8],\n",
       " (18, 5, False): [0.8, 0.2],\n",
       " (21, 7, True): [0.8, 0.2],\n",
       " (16, 7, False): [0.2, 0.8],\n",
       " (20, 7, False): [0.8, 0.2],\n",
       " (5, 5, False): [0.2, 0.8],\n",
       " (20, 1, True): [0.8, 0.2],\n",
       " (19, 2, False): [0.8, 0.2],\n",
       " (21, 8, True): [0.2, 0.8],\n",
       " (7, 7, False): [0.2, 0.8],\n",
       " (15, 7, False): [0.2, 0.8],\n",
       " (21, 4, True): [0.8, 0.2],\n",
       " (13, 3, False): [0.2, 0.8],\n",
       " (13, 8, False): [0.2, 0.8],\n",
       " (12, 4, False): [0.2, 0.8],\n",
       " (8, 3, False): [0.2, 0.8],\n",
       " (19, 3, True): [0.8, 0.2],\n",
       " (14, 8, False): [0.2, 0.8],\n",
       " (6, 2, False): [0.2, 0.8],\n",
       " (16, 3, False): [0.2, 0.8],\n",
       " (5, 1, False): [0.2, 0.8],\n",
       " (7, 4, False): [0.2, 0.8],\n",
       " (16, 4, False): [0.8, 0.2],\n",
       " (18, 10, True): [0.2, 0.8],\n",
       " (17, 1, True): [0.2, 0.8],\n",
       " (19, 1, True): [0.2, 0.8],\n",
       " (8, 5, False): [0.2, 0.8],\n",
       " (16, 6, False): [0.2, 0.8],\n",
       " (15, 10, True): [0.2, 0.8],\n",
       " (17, 10, True): [0.2, 0.8],\n",
       " (5, 2, False): [0.8, 0.2],\n",
       " (18, 9, False): [0.8, 0.2],\n",
       " (19, 10, True): [0.2, 0.8],\n",
       " (8, 1, False): [0.2, 0.8],\n",
       " (16, 1, False): [0.2, 0.8],\n",
       " (6, 8, False): [0.2, 0.8],\n",
       " (11, 10, False): [0.2, 0.8],\n",
       " (16, 5, False): [0.8, 0.2],\n",
       " (10, 6, False): [0.2, 0.8],\n",
       " (19, 4, False): [0.8, 0.2],\n",
       " (10, 2, False): [0.2, 0.8],\n",
       " (20, 2, True): [0.8, 0.2],\n",
       " (11, 3, False): [0.2, 0.8],\n",
       " (13, 10, True): [0.2, 0.8],\n",
       " (6, 7, False): [0.2, 0.8],\n",
       " (10, 4, False): [0.2, 0.8],\n",
       " (15, 6, False): [0.2, 0.8],\n",
       " (17, 3, False): [0.2, 0.8],\n",
       " (9, 8, False): [0.2, 0.8],\n",
       " (9, 4, False): [0.2, 0.8],\n",
       " (6, 1, False): [0.8, 0.2],\n",
       " (10, 8, False): [0.2, 0.8],\n",
       " (9, 9, False): [0.2, 0.8],\n",
       " (11, 4, False): [0.2, 0.8],\n",
       " (21, 4, False): [0.8, 0.2],\n",
       " (21, 10, True): [0.8, 0.2],\n",
       " (11, 2, False): [0.2, 0.8],\n",
       " (18, 2, False): [0.8, 0.2],\n",
       " (17, 6, False): [0.8, 0.2],\n",
       " (18, 4, False): [0.8, 0.2],\n",
       " (19, 6, False): [0.8, 0.2],\n",
       " (14, 7, False): [0.2, 0.8],\n",
       " (13, 1, False): [0.2, 0.8],\n",
       " (17, 9, False): [0.2, 0.8],\n",
       " (15, 1, False): [0.2, 0.8],\n",
       " (12, 3, False): [0.2, 0.8],\n",
       " (10, 3, False): [0.2, 0.8],\n",
       " (20, 3, False): [0.8, 0.2],\n",
       " (18, 7, False): [0.8, 0.2],\n",
       " (14, 7, True): [0.8, 0.2],\n",
       " (5, 10, False): [0.2, 0.8],\n",
       " (14, 1, True): [0.2, 0.8],\n",
       " (19, 5, True): [0.8, 0.2],\n",
       " (8, 9, False): [0.2, 0.8],\n",
       " (19, 9, True): [0.2, 0.8],\n",
       " (14, 9, False): [0.2, 0.8],\n",
       " (15, 9, False): [0.2, 0.8],\n",
       " (6, 10, False): [0.2, 0.8],\n",
       " (17, 5, False): [0.8, 0.2],\n",
       " (20, 10, True): [0.2, 0.8],\n",
       " (10, 9, False): [0.2, 0.8],\n",
       " (18, 6, False): [0.8, 0.2],\n",
       " (21, 1, False): [0.8, 0.2],\n",
       " (15, 7, True): [0.2, 0.8],\n",
       " (13, 7, False): [0.2, 0.8],\n",
       " (4, 2, False): [0.2, 0.8],\n",
       " (9, 2, False): [0.2, 0.8],\n",
       " (6, 4, False): [0.8, 0.2],\n",
       " (19, 6, True): [0.2, 0.8],\n",
       " (20, 4, True): [0.8, 0.2],\n",
       " (12, 7, True): [0.2, 0.8],\n",
       " (4, 5, False): [0.8, 0.2],\n",
       " (12, 9, False): [0.2, 0.8],\n",
       " (21, 8, False): [0.8, 0.2],\n",
       " (16, 1, True): [0.2, 0.8],\n",
       " (11, 9, False): [0.2, 0.8],\n",
       " (18, 1, True): [0.2, 0.8],\n",
       " (12, 7, False): [0.2, 0.8],\n",
       " (15, 2, True): [0.2, 0.8],\n",
       " (8, 4, False): [0.8, 0.2],\n",
       " (16, 8, False): [0.8, 0.2],\n",
       " (4, 8, False): [0.2, 0.8],\n",
       " (18, 5, True): [0.8, 0.2],\n",
       " (5, 6, False): [0.8, 0.2],\n",
       " (11, 8, False): [0.2, 0.8],\n",
       " (7, 8, False): [0.2, 0.8],\n",
       " (20, 5, False): [0.8, 0.2],\n",
       " (18, 9, True): [0.8, 0.2],\n",
       " (15, 3, True): [0.2, 0.8],\n",
       " (17, 6, True): [0.2, 0.8],\n",
       " (4, 6, False): [0.8, 0.2],\n",
       " (17, 4, True): [0.2, 0.8],\n",
       " (4, 3, False): [0.2, 0.8],\n",
       " (13, 1, True): [0.2, 0.8],\n",
       " (19, 4, True): [0.8, 0.2],\n",
       " (4, 9, False): [0.2, 0.8],\n",
       " (12, 10, True): [0.2, 0.8],\n",
       " (11, 7, False): [0.2, 0.8],\n",
       " (4, 1, False): [0.2, 0.8],\n",
       " (7, 2, False): [0.2, 0.8],\n",
       " (15, 1, True): [0.2, 0.8],\n",
       " (21, 5, True): [0.8, 0.2],\n",
       " (6, 6, False): [0.2, 0.8],\n",
       " (21, 3, False): [0.8, 0.2],\n",
       " (12, 2, True): [0.2, 0.8],\n",
       " (6, 9, False): [0.2, 0.8],\n",
       " (20, 9, True): [0.2, 0.8],\n",
       " (14, 6, True): [0.2, 0.8],\n",
       " (13, 4, True): [0.2, 0.8],\n",
       " (18, 4, True): [0.2, 0.8],\n",
       " (19, 8, True): [0.8, 0.2],\n",
       " (21, 9, True): [0.8, 0.2],\n",
       " (6, 5, False): [0.8, 0.2],\n",
       " (18, 3, True): [0.2, 0.8],\n",
       " (7, 6, False): [0.8, 0.2],\n",
       " (15, 8, True): [0.2, 0.8],\n",
       " (19, 7, True): [0.8, 0.2],\n",
       " (14, 10, True): [0.2, 0.8],\n",
       " (21, 9, False): [0.8, 0.2],\n",
       " (5, 7, False): [0.2, 0.8],\n",
       " (17, 3, True): [0.8, 0.2],\n",
       " (7, 9, False): [0.2, 0.8],\n",
       " (9, 6, False): [0.8, 0.2],\n",
       " (18, 2, True): [0.2, 0.8],\n",
       " (20, 8, True): [0.8, 0.2],\n",
       " (12, 1, True): [0.8, 0.2],\n",
       " (8, 2, False): [0.2, 0.8],\n",
       " (19, 2, True): [0.8, 0.2],\n",
       " (10, 7, False): [0.2, 0.8],\n",
       " (18, 8, True): [0.8, 0.2],\n",
       " (16, 4, True): [0.8, 0.2],\n",
       " (16, 5, True): [0.2, 0.8],\n",
       " (16, 8, True): [0.2, 0.8],\n",
       " (16, 9, True): [0.2, 0.8],\n",
       " (5, 8, False): [0.2, 0.8],\n",
       " (16, 7, True): [0.8, 0.2],\n",
       " (16, 3, True): [0.2, 0.8],\n",
       " (17, 9, True): [0.2, 0.8],\n",
       " (5, 4, False): [0.2, 0.8],\n",
       " (20, 5, True): [0.8, 0.2],\n",
       " (8, 8, False): [0.2, 0.8],\n",
       " (15, 5, True): [0.8, 0.2],\n",
       " (17, 5, True): [0.8, 0.2],\n",
       " (13, 8, True): [0.8, 0.2],\n",
       " (14, 5, True): [0.2, 0.8],\n",
       " (14, 9, True): [0.8, 0.2],\n",
       " (14, 8, True): [0.2, 0.8],\n",
       " (12, 8, True): [0.2, 0.8],\n",
       " (13, 5, True): [0.8, 0.2],\n",
       " (4, 7, False): [0.2, 0.8],\n",
       " (20, 7, True): [0.2, 0.8],\n",
       " (12, 5, True): [0.2, 0.8],\n",
       " (13, 6, True): [0.2, 0.8],\n",
       " (16, 2, True): [0.2, 0.8],\n",
       " (15, 9, True): [0.8, 0.2],\n",
       " (4, 4, False): [0.2, 0.8],\n",
       " (15, 4, True): [0.2, 0.8],\n",
       " (13, 7, True): [0.8, 0.2],\n",
       " (13, 2, True): [0.2, 0.8],\n",
       " (12, 9, True): [0.2, 0.8],\n",
       " (12, 3, True): [0.2, 0.8],\n",
       " (14, 3, True): [0.2, 0.8],\n",
       " (18, 7, True): [0.8, 0.2],\n",
       " (5, 9, False): [0.2, 0.8],\n",
       " (18, 6, True): [0.8, 0.2],\n",
       " (5, 3, False): [0.2, 0.8]}"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "policy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "3db78f96",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-1302.0\n"
     ]
    }
   ],
   "source": [
    "# 总奖励\n",
    "total_rewards = 0\n",
    "for k,v in rewards.items():\n",
    "    total_rewards += sum(v[0])\n",
    "    total_rewards += sum(v[1])\n",
    "print(total_rewards)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
